package com.lagou.service.impl;


import com.lagou.dao.ResumeDao;
import com.lagou.pojo.Resume;
import com.lagou.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class ResumeServiceImpl implements ResumeService {
    @Autowired
    private ResumeDao resumeDao;

    @Override
    public Resume findById(Long id) {
        Optional<Resume> optional = resumeDao.findById(id);
        Resume resume = optional.get();
        System.out.println(resume);
        return resume;
    }

    @Override
    public List<Resume> list() {
        List<Resume> all = resumeDao.findAll();
        return all;
    }

    @Override
    public void deleteById(Long id) {
        resumeDao.deleteById(id);
    }

    @Override
    public void save(Resume resume) {
        resumeDao.save(resume);
    }
}
